﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Forecast.Domain.Implementation
{
    class Prediction : IPredict
    {
        #region Variables

        public static Prediction NULL = new Prediction("NULL", "NULL", "NULL", DateTime.Today);
        private string _ticker;
        private string _shortDescription;
        private string _description;
        private bool _isActive;
        private DateTime _endDate;
        private int _activityLevel;

        #endregion
        #region Constructors

        public Prediction(string ticker, string shortDescription, string description, DateTime endDate)
        {
            if (ticker == null)
                throw new ArgumentNullException("ticker");
            if (shortDescription == null)
                throw new ArgumentNullException("shortDescription");
            if (description == null)
                throw new ArgumentNullException("description");
            if (endDate == DateTime.MaxValue || endDate == DateTime.MinValue)
                throw new ArgumentNullException("endDate");
            if (endDate < DateTime.Today)
                throw new ArgumentException("End date can't be set to the past.");
            ticker = ticker.Trim();
            if (ticker.Length < 3 || ticker.Length > 5)
                throw new ArgumentException("The ticker should be 3 to 5 characters long.");

            _ticker = ticker;
            _shortDescription = shortDescription;
            _description = description;
            _endDate = endDate;
        }

        #endregion
        #region Properties

        public string ShortDescription
        {
            get { return _shortDescription; }
            set { _shortDescription = value; }
        }

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        public bool IsActive
        {
            get { return _isActive; }
        }

        public string Ticker
        {
            get { return _ticker; }
        }

        public DateTime EndDate
        {
            get { return _endDate; }
        }

        #endregion      
    }
}
